import java.util.*;

/**
 * @author LKQ
 * @date 2022/4/16 10:32
 * @description
 */
public class Solution {
    public static void main(String[] args) {
        Solution solution = new Solution();
        int[] nums = {1,1,1};
        solution.waysToSplit(nums);
    }
    public int waysToSplit(int[] nums) {
        int n = nums.length;
        int[] preSum = new int[n + 1];
        for (int i = 0; i < n; i++) {
            preSum[i + 1] = preSum[i] + nums[i];
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            int a = preSum[i + 1] - preSum[0];
            if (a > preSum[n] / 3) {
                break;
            }
            for (int j = i + 1; j < n; j++) {
                int b = preSum[j + 1] - preSum[i + 1];
                int c = preSum[n] - preSum[j + 1];
                if (b >= a && c >= b) {
                    ans++;
                    ans %= (1e9 + 7);
                }
            }
        }
        return ans;
    }
}
